define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
        var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: '/sys/quartzjob/data',
                    add_url: '/sys/quartzjob/add',
                    edit_url: '/sys/quartzjob/edit',
                    del_url: '/sys/quartzjob/del',
                    multi_url: 'data/multi.json',
                    "table": 'page',
                }
            });
            var table = $("#table");
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                sortName: 'id',
                columns: [
                    [
                        {field: 'aaa', checkbox: true},
                        {field: 'id', title: __('id'), operate: false},
                        {field: 'job_name', title: __('定时器名称'), operate: false},
                        {field: 'bean_name', title: __('Bean名称'), operate: false},
                        {field: 'method_name', title: __('方法名称'), operate: false},
                        {field: 'params', title: __('参数'), operate: false},
                        {field: 'cron_expression', title: __('cron表达式'), operate: false},
                        {field: 'is_pause', title: __('状态'), operate: false},
                        {field: 'email', title: __('报警邮箱'), operate: false},
                        {field: 'description', title: __('备注'), operate: false},
                        {field: 'create_time', title: __('create_time'), formatter: Table.api.formatter.datetime, operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'},
                        {field: 'update_time', title: __('update_time'), formatter: Table.api.formatter.datetime, operate:false},
                        {field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: function (value, row, index) {
                                return Table.api.formatter.operate(value, row, index, table);
                            }
                        }
                    ]
                ],
                //禁用默认搜索
                search: false,
                //启用普通表单搜索
                commonSearch: true,
                //可以控制是否默认显示搜索单表,false则隐藏,默认为false
                searchFormVisible: true,
                exportDataType: 'selected'
            });
            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    Controller.api.bindevent();
    return Controller;
});